package compilador;
/**
 *  Clase que permite almacenar en un ArrayList una lista de reglas y luego sacar el String de cada una.
 */
import java.util.ArrayList;

public class ListaReglas {
	
	public static final int PROGRAMA = 0;
	public static final int ENTRADA = 1;
	
	public static final int DO_LOOP_WHILE = 2;
	public static final int EXIT = 3;
	public static final int IF = 4;
	
	public static final int LOCATE = 5;
	public static final int PRINT = 6;
	public static final int INPUT = 7;
	public static final int CLS = 8;
	
	public static final int DECLARACION = 9;
	public static final int DECLARACION_VARS = 10;
	public static final int VARS_DIM = 11;
	public static final int ID_DIM = 12;
	public static final int TIPO_DIM = 13;
	
	public static final int REGISTRO = 14;
	public static final int NOMBRE_REGISTRO = 15;
	public static final int CAMPOS_REGISTRO = 16;
	public static final int NOMBRE_CAMPO = 17;
	public static final int TIPO_DEL_CAMPO = 18;
	
	public static final int DECLARE_FUNCION = 19;
	public static final int FUNCION = 20;
	public static final int ARGUMENTOS_FUNCION = 21;
	public static final int ARGUMENTO_FUNCION = 22;
	public static final int ARGUMENTOS_DECL_FUNCION = 23;
	public static final int ARGUMENTO_DECL_FUNCION = 24;
	
	public static final int CONDICION = 25;
	public static final int COMPARACION = 26;
	public static final int EXPRESION = 27;
	public static final int TERMINO = 28;
	public static final int FACTOR = 29;
	
	public static final int VARIABLE = 30;
	public static final int VARIABLE_REGISTRO = 31;
	public static final int VARIABLE_ARRAY_FUNC_CALL = 32;

	public static final int ASIGNACION = 33;
	public static final int CONSTANTE = 34;
	
	public static final int EOL = 35;
	
	public static final int NEGADOR = 36;
	
	public static final String TXT_VALOR[] = {
		"Programa", // 0
		"Entrada", // 1
		
		"Do_Loop_While", // 2
		"Exit", // 3
		"If", // 4
		
		"Locate", // 5
		"Print", // 6
		"Input", // 7
		"CLS", // 8
		
		"Declaracion", // 9
		"Declaracion_vars", // 10
		"Vars_dim", // 11
		"Id_dim", // 12
		"Tipo_dim", // 13
		
		"Registro", // 14
		"Nombre_registro", // 15
		"Campos_registro", // 16
		"Nombre_campo", // 17
		"Tipo_del_campo", // 18
		
		"Declare_funcion", // 19
		"Funcion", // 20
		"Argumentos_funcion", // 21
		"Argumento_funcion", // 22
		"Argumentos_decl_funcion", // 23
		"Argumento_decl_funcion", // 24
		
		"Condicion", // 25
		"Comparacion", // 26
		"Expresion", // 27
		"Termino", // 28
		"Factor", // 29
		
		"Variable",  //30
		"Variable_registro", // 31
		"Variable_array_func_call", // 32
		
		"Asignacion", // 33
		"Constante", // 34

		"<EOL>",  // 35
		
		"Negador Comp", // 36
	};
	
	private static ArrayList<Integer> reglas = new ArrayList<Integer>();
	
	public ListaReglas(){
		reglas=new ArrayList<Integer>();
	}
	
	public static void reinicia(){
		reglas= new ArrayList<Integer>();
	}
	
	public static void add(int regla){
		reglas.add(regla);
	}
	
	public static String get(int i){
		int v= reglas.get(i);
		return TXT_VALOR[v];
	}
	
	public static int size(){return reglas.size();}
	
	

}
